import { ref, onMounted } from "vue";
import axios from "axios";
export default function useGetDog() {
  const dogUrl = ref("");
  const getDog = async () => {
    const result = await axios.get(`https://dog.ceo/api/breeds/image/random`);
    dogUrl.value = result.data.message;
  };
  onMounted(() => {
    console.log("dog图片初始化");
  });

  return {
    dogUrl,
    getDog,
  };
}
